package xsxdjc
public class UserInfo{
	public static Closure rule = {_context_ ->
		HashMap _result_ = new HashMap();
		_result_.rname = 'UserInfo';
		_result_.rpath = 'xsxdjc/UserInfo';
		
		//before query as below
		//execute sql query
		String _SQL_statement_ = """
		select * from user where id =${userId}
		""";
		String _all_statement_ = """
		select * from user
		""";
		
		_result_.data = new Object(){
			
			java.util.concurrent.CompletableFuture<List<Map<String, Object>>> SQL =
				 java.util.concurrent.CompletableFuture.supplyAsync({return (new org.springframework.jdbc.core.JdbcTemplate(Setting.jdbcTemplate.dataSource)).queryForList(_SQL_statement_)});
			List<Map<String, Object>> getSQL(){return SQL.get();};
			
			java.util.concurrent.CompletableFuture<List<Map<String, Object>>> all =
				 java.util.concurrent.CompletableFuture.supplyAsync({return (new org.springframework.jdbc.core.JdbcTemplate(Setting.jdbcTemplate.dataSource)).queryForList(_all_statement_)});
			List<Map<String, Object>> getAll(){return all.get();};
		};
		//after sql query execution
		output(_result_.data.all)
		
		return _result_;
	};
};